#include"progress.h"

#define SIZE 101
#define MAX_RATE 100
#define STYLE '&'
#define STIME 1000*250

const char *str="|/-\\";

void process()
{
    int rate=0;
    char bar[SIZE];
    memset(bar,'\0',sizeof(bar));
    int num=strlen(str);
    while(rate <= MAX_RATE)
    {
        printf("[%-100s][%d%%][%c]\r",bar,rate,str[rate%num]);
        fflush(stdout);
        usleep(STIME);
        bar[rate++]=STYLE;
    }
    printf("\n");
}
